package com.ruoyi.userManage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.userManage.mapper.PackageMapper;
import com.ruoyi.userManage.domain.Package;
import com.ruoyi.userManage.service.IPackageService;

/**
 * 背包记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-12
 */
@Service
public class PackageServiceImpl implements IPackageService 
{
    @Autowired
    private PackageMapper packageMapper;

    /**
     * 查询背包记录
     * 
     * @param id 背包记录主键
     * @return 背包记录
     */
    @Override
    public Package selectPackageById(Long id)
    {
        return packageMapper.selectPackageById(id);
    }

    /**
     * 查询背包记录列表
     * 
     * @param packages 背包记录
     * @return 背包记录
     */
    @Override
    public List<Package> selectPackageList(Package packages)
    {
        return packageMapper.selectPackageList(packages);
    }

    /**
     * 新增背包记录
     * 
     * @param packages 背包记录
     * @return 结果
     */
    @Override
    public int insertPackage(Package packages)
    {
        packages.setCreateTime(DateUtils.getNowDate());
        return packageMapper.insertPackage(packages);
    }

    /**
     * 修改背包记录
     * 
     * @param packages 背包记录
     * @return 结果
     */
    @Override
    public int updatePackage(Package packages)
    {
        packages.setUpdateTime(DateUtils.getNowDate());
        return packageMapper.updatePackage(packages);
    }

    /**
     * 批量删除背包记录
     * 
     * @param ids 需要删除的背包记录主键
     * @return 结果
     */
    @Override
    public int deletePackageByIds(Long[] ids)
    {
        return packageMapper.deletePackageByIds(ids);
    }

    /**
     * 删除背包记录信息
     * 
     * @param id 背包记录主键
     * @return 结果
     */
    @Override
    public int deletePackageById(Long id)
    {
        return packageMapper.deletePackageById(id);
    }
}
